/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.transfer.bean.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 风险数据对接认证配置
 *
 * @author pig
 * @date 2024-02-01 20:09:14
 */
@Data
@TableName("risk_transfer_auth")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "风险数据对接认证配置")
public class RiskTransferAuthEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "id")
    private Long id;

    /**
     * 令牌
     */
    @Schema(description = "令牌")
    private String token;

    /**
     * 对接标记，0不对接，1对接
     */
    @Schema(description = "对接标记，0不对接，1对接")
    @TableField(value = "`use`")
    private Boolean use;

    /**
     * 加密秘钥
     */
    @Schema(description = "加密秘钥")
    @TableField(value = "`key`")
    private String key;

    /**
     * orgId
     */
    @Schema(description = "orgId")
    private Long orgId;


    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, orgId);
    }
}